#ifndef DW_SYSTEM_LOGGER_INL
#	define DW_SYSTEM_LOGGER_INL

namespace dw {
	namespace system {

//------------------------------------------------------------------------------
// Construction & destruction
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
inline Logger::Logger()
:	_filter(LVL_ALL)
{
}

//------------------------------------------------------------------------------
inline Logger::~Logger() 
{
	dwAssert(_listeners.empty(), "Some listeners have not been unregistered");
}

//------------------------------------------------------------------------------
// Setup
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
inline void Logger::enable(Level level)
{
	dwAssert(level < LVL_COUNT, "Invalid parameter: level is out of bounds");

	_filter = _filter | (0x01 << level);
}

//------------------------------------------------------------------------------
inline void Logger::disable(Level level)
{
	dwAssert(level < LVL_COUNT, "Invalid parameter: level is out of bounds");

	_filter = _filter & (~(0x01 << level));
}

//------------------------------------------------------------------------------
// State
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
inline bool Logger::levelIsEnabled(Level level) const
{
	dwAssert(level < LVL_COUNT, "Invalid parameter: level is out of bounds");

	return (_filter & (0x01 << level)) != 0;
}

	}
}

#endif // !DW_SYSTEM_LOGGER_INL
